﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.ComponentModel.DataAnnotations;
using System.Data.Objects.DataClasses;

using System.Collections.ObjectModel;

namespace LEEAAttendanceControl.Web
{
    public class TreeNode
    {
        public string Name { get; set; }

        public int CompanyID { get; set; }

        public int DepartmentID { get; set; }

        public int EmployeeId { get; set; }

        public int Type { get; set; }

        public string Color { get; set; }

        public ObservableCollection<TreeNode> Nodes { get; set; }

        public TreeNode() { }

        public TreeNode(int type,string name, int comId, int depId,int empid, string color, params TreeNode[] nodes)
        {
            Name = name;

            CompanyID = comId;

            DepartmentID = depId;

            EmployeeId = empid;

            Type=type;

            Color = color;
            
            ObservableCollection<TreeNode> innerNodes = new ObservableCollection<TreeNode>();

            foreach (TreeNode node in nodes)
            {
                innerNodes.Add(node);
            }

            Nodes = innerNodes;
        }
    }
}